<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>
import cookie from 'js-cookie'

export default {
  name: 'My',
  created () {
    this.initData()
  },
  methods: {
    initData () {
      const token = cookie.get('token')
      if (token) {
        this.$store.dispatch('user/getUserInfo')
      }
    }
  }
}
</script>
